package com.example.kflogin

import android.content.Intent
import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import android.view.View
import android.widget.Toast

class MainActivity : AppCompatActivity(), View.OnClickListener {

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_main)
    }

    fun logInToast(v: View) {
        Toast.makeText(this, "Log in Button Toast", Toast.LENGTH_SHORT).show()
    }

    override fun onClick(v: View) {
        when(v.id) {
            R.id.button_register -> {
                val intent = Intent(this@MainActivity, RegisterActivity::class.java)
                startActivity(intent)
            }
            R.id.register_finish -> {
                finish()
            }
            else -> println("error")
        }
    }
}
